﻿#ifndef LOGIN_WIDGET_H
#define LOGIN_WIDGET_H

#include <QWidget>
#include <QMenu>
#include <QMouseEvent>
#include <QMessageBox>

#include "register_widget.h"
#include "facelogin.h"
#include "mainfunction.h"

#include "alltools.h"

namespace Ui {
class login_widget;
}

class login_widget : public QWidget
{
    Q_OBJECT

public:
    explicit login_widget(QWidget *parent = nullptr);

    ~login_widget();

//protected:
//    bool eventFilter(QObject *watched, QEvent *event);

private slots:
    void pushButtonRegister_clicked();

    void pushButtonLogin_clicked();

    void on_pushButtonMin_clicked();

    void on_pushButtonQuit_clicked();

signals:
    void LoginToFaceLogin(QMap<QString,QString> res);
    void LogintoRegister();
    void closeAll();

private:
    Ui::login_widget *ui;
    register_widget* rwp;
    FaceLogin* flp;
    MainFunction* Mainfucp;

    QMessageBox boxFalse;
    QMessageBox boxTrue;
    void ConnectSlots();

protected:
    void mousePressEvent(QMouseEvent *e);
    void mouseMoveEvent(QMouseEvent *e);
    void mouseReleaseEvent(QMouseEvent *e);

private:
    QPoint last;

};

#endif // LOGIN_WIDGET_H
